package com.example.footballsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.footballsystem.entity.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {
    @Select("select * from post_user where userAccount=#{userAccount}")
    public List<Comment> getCommentByAccount(String userAccount);
    @Select("select * from post_user where schoolNewID=#{schoolNewID}")
    public List<Comment> getCommentByPost(int schoolNewID );
    @Insert("insert into post_user values (#{schoolNewID},#{userAccount},#{content},#{userimage},#{username})")
    public Boolean addComment(Comment comment);
}
